package com.woniu.outlet.dao;

import com.woniu.outlet.po.UserPo;
import com.woniu.outlet.po.UserPoExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserPoMapper {
    long countByExample(UserPoExample example);

    int deleteByExample(UserPoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(UserPo record);

    int insertSelective(UserPo record);

    List<UserPo> selectByExample(UserPoExample example);

    UserPo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") UserPo record, @Param("example") UserPoExample example);

    int updateByExample(@Param("record") UserPo record, @Param("example") UserPoExample example);

    int updateByPrimaryKeySelective(UserPo record);

    int updateByPrimaryKey(UserPo record);

    @Select("select p.percode\n" +
            "from rbac_perms p inner join rbac_user_perm up on (p.id = up.permid)\n" +
            "\t\t\t\t\t\t\t\t\tinner join rbac_user u on (u.id = up.userid)\n" +
            "where u.username=#{username}")
    List<String> selectPercodeByPerm(String username);
}